Outputs the specified strings or numeric expressions to a dialog or to a file.
指定された文字列または数値表式をダイアログまたはファイルに出力します。
Print [#FileName,] Expression1[{;|,} [Spc(Number As Integer);] [Tab(pos As Integer);] [Expression2[...]]
Print [#FileName,] Expression1[{;|,} [Spc(Number As Integer);] [Tab(pos As Integer);] [Expression2[...]]
FileName: Any numeric expression that contains the file number that was set by the Open statement for the respective file.
FileName: 該当ファイルに対し Open ステートメントが割り当てたファイル番号を示す数値表式。
Expression: Any numeric or string expression to be printed. Multiple expressions can be separated by a semicolon. If separated by a comma, the expressions are indented to the next tab stop. The tab stops cannot be adjusted.
Expression:ダイアログボックス上に表示する数値ないし文字列表式。複数の表式を表示する場合は、セミコロンで区切ります。コンマで区切った場合は、表式は次のタブストップ位置にインデントして表示されます。タブストップの位置は変更できません。
Number: Number of spaces to be inserted by the Spc function.
Number:Spc 関数で挿入させるスペース記号の数。
Pos: Spaces are inserted until the specified position.
Pos:指定位置までスペース記号を挿入させます。
If a semicolon or comma appears after the last expression to be printed, Office Basic stores the text in an internal buffer and continues program execution without printing. When another Print statement without a semicolon or comma at the end is encountered, all text to be printed is printed at once.
表示用の表式の末尾にセミコロンやコンマを付けておくと、Office Basic はこれらのテキストを内部バッファに格納し、ダイアログを表示することなくプログラムを続行します。そして、末尾にセミコロンやコンマの付いていない他の Print ステートメントを実行する段階で、蓄積しておいた表示テキストを一括して出力します。
Positive numeric expressions are printed with a leading space. Negative expressions are printed with a leading minus sign. If a certain range is exceeded for floating-point values, the respective numeric expression is printed in exponential notation.
正の数値表式の場合は、先頭にスペース記号が付加されます。正の数値表式の場合は、先頭にマイナス記号が付加されます。特定範囲を超えた浮動小数点値の場合は、該当する値を指数形式で表示します。
If the expression to be printed exceeds a certain length, the display will automatically wrap to the next line.
表式が特定の長さを超えた場合は、強制的に改行された複数行表示にされます。
![]() | You can insert the Tab function, enclosed by semicolons, between arguments to indent the output to a specific position, or you can use the Spc function to insert a specified number of spaces.
引数の間にセミコロンで挟む形で Tab 関数を記述すると、表示内容を特定の位置までインデントさせることができ、同様に Spc 関数を記述すると、特定の数のスペース記号を挿入できます。 |
Sub ExamplePrint
Sub ExamplePrint
Print "ABC"
Print "ABC"
Print "ABC","123"
Print "ABC","123"
i = FreeFile()
i = FreeFile()
Open "C:\Temp.txt""~/temp.txt" For Output As i
Open "C:\Temp.txt""~/temp.txt" For Output As i
Print #i, "ABC"
Print #i, "ABC"
Close #i
Close #i
end Sub
end Sub